var express = require('express');
var router = express.Router();
const Mock = require('mockjs');

router.get('/list', function (req, res, next) {
  let data = Mock.mock({
    'list|5': [{
      'id|+1': 1,
      'name': '@cname',
      'age|1-100': 1,
      'email': '@email',
      'phone': /^1[34578]\d{9}$/,
      'address': '@county(true)'
    }]
  })
  console.log(data);
  
  res.send({
    code: 200,
    msg: '获取数据成功',
    data: data.list
  });

});

module.exports = router;
